<?php /* Smarty version Smarty-3.1.12, created on 2013-04-15 21:46:13
         compiled from "D:\wamp\www\acps_new\templates\clients\list.tpl" */ ?>
<?php /*%%SmartyHeaderCode:1351550c0fa82003cc0-38379507%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    'da7db06ceca410361f41bc4791275ca5374cb14b' => 
    array (
      0 => 'D:\\wamp\\www\\acps_new\\templates\\clients\\list.tpl',
      1 => 1366062368,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '1351550c0fa82003cc0-38379507',
  'function' => 
  array (
  ),
  'version' => 'Smarty-3.1.12',
  'unifunc' => 'content_50c0fa824b9f62_91986090',
  'variables' => 
  array (
    'data' => 0,
    'filter' => 0,
    'value' => 0,
    'counter' => 0,
    'bgClass' => 0,
    'client' => 0,
  ),
  'has_nocache_code' => false,
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_50c0fa824b9f62_91986090')) {function content_50c0fa824b9f62_91986090($_smarty_tpl) {?><script type="text/javascript">
    
        $(document).ready(function() {
            $("#fulltext").keyup(function(event){
                if(event.keyCode == 13){
                    setFulltext($('#fulltext').val(),'list_of_clients_fulltext')
                }
            });
            $("#fulltext").focus();
        });
    
</script>

<ul class="subNavig">
    <li><a href="<?php echo $_smarty_tpl->tpl_vars['data']->value['root'];?>
?input=list_of_clients">Clients</a></li>
    <li><a href="<?php echo $_smarty_tpl->tpl_vars['data']->value['root'];?>
?input=list_of_users">Users</a></li>
    <li><a href="<?php echo $_smarty_tpl->tpl_vars['data']->value['root'];?>
?input=list_of_tariffs">Tariffs</a></li>
</ul>
<h2 class="pageTitle">List of clients</h2>
<?php echo $_smarty_tpl->getSubTemplate ($_smarty_tpl->tpl_vars['data']->value['pathToError'], $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);?>

<?php if ($_smarty_tpl->tpl_vars['data']->value['currentFilter']||$_smarty_tpl->tpl_vars['data']->value['currentFulltext']!=''){?>
    <div class="menu-list bgDark">
        <b>Current filter:</b> 
        <ul>
            <?php  $_smarty_tpl->tpl_vars['value'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['value']->_loop = false;
 $_smarty_tpl->tpl_vars['filter'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['data']->value['currentFilter']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['value']->key => $_smarty_tpl->tpl_vars['value']->value){
$_smarty_tpl->tpl_vars['value']->_loop = true;
 $_smarty_tpl->tpl_vars['filter']->value = $_smarty_tpl->tpl_vars['value']->key;
?>
                <li><?php echo $_smarty_tpl->tpl_vars['filter']->value;?>
 = <i><?php echo $_smarty_tpl->tpl_vars['value']->value;?>
</i> [<a href="javascript: cancelFilter('<?php echo $_smarty_tpl->tpl_vars['filter']->value;?>
','list_of_clients_filter')" class="baseLink">Cancel</a>]</li>
            <?php } ?>
            <?php if ($_smarty_tpl->tpl_vars['data']->value['currentFulltext']!=''){?>
                <li>Fulltext = <i><?php echo $_smarty_tpl->tpl_vars['data']->value['currentFulltext'];?>
</i> [<a href="javascript: cancelFulltext('list_of_clients_fulltext')" class="baseLink">Cancel</a>]</li>
            <?php }?>
        </ul>
    </div>
<?php }?>
<div class="menu-list">
    Fulltext search: <input id="fulltext" type="text" value="<?php if ($_smarty_tpl->tpl_vars['data']->value['currentFulltext']!=''){?><?php echo $_smarty_tpl->tpl_vars['data']->value['currentFulltext'];?>
<?php }?>" /><input value="Search" type="button" onclick="setFulltext($('#fulltext').val(),'list_of_clients_fulltext')" />
</div>
<form action="<?php echo $_smarty_tpl->tpl_vars['data']->value['root'];?>
?input=list_of_clients" method="post" id="addingClient">
    <div class="menu-list">
        <a href="<?php echo $_smarty_tpl->tpl_vars['data']->value['root'];?>
?input=add_client" class="basicButton">Add client</a>
        <select name="action" onchange="submitForm('addingClient')">
            <option value="">Actions ...</option>
            <option value="deleteClients">Delete client(s)</option>
        </select>
    </div>
    <table class="list">
        <tr>
            <th><input type="checkbox" id="checkAll" onchange="checkIt('checkAll')" /></th>
            <th><a href="javascript: order('name','list_of_clients_order')">Name <?php if ($_smarty_tpl->tpl_vars['data']->value['currentOrder'][0]=="name"){?><img src="<?php echo $_smarty_tpl->tpl_vars['data']->value['root'];?>
images/<?php echo $_smarty_tpl->tpl_vars['data']->value['currentOrder'][1];?>
.png" height="14" width="14" /><?php }?></a></th>
            <th><a href="javascript: order('fullName','list_of_clients_order')">Full name <?php if ($_smarty_tpl->tpl_vars['data']->value['currentOrder'][0]=="fullName"){?><img src="<?php echo $_smarty_tpl->tpl_vars['data']->value['root'];?>
images/<?php echo $_smarty_tpl->tpl_vars['data']->value['currentOrder'][1];?>
.png" height="14" width="14" /><?php }?></a></th>
            <th><a href="javascript: order('ICO','list_of_clients_order')">ICO <?php if ($_smarty_tpl->tpl_vars['data']->value['currentOrder'][0]=="ICO"){?><img src="<?php echo $_smarty_tpl->tpl_vars['data']->value['root'];?>
images/<?php echo $_smarty_tpl->tpl_vars['data']->value['currentOrder'][1];?>
.png" height="14" width="14" /><?php }?></a></th>
            <th><a href="javascript: order('ICDPH','list_of_clients_order')">ICDPH <?php if ($_smarty_tpl->tpl_vars['data']->value['currentOrder'][0]=="ICDPH"){?><img src="<?php echo $_smarty_tpl->tpl_vars['data']->value['root'];?>
images/<?php echo $_smarty_tpl->tpl_vars['data']->value['currentOrder'][1];?>
.png" height="14" width="14" /><?php }?></a></th>
            <th><a href="javascript: order('address','list_of_clients_order')">Address <?php if ($_smarty_tpl->tpl_vars['data']->value['currentOrder'][0]=="address"){?><img src="<?php echo $_smarty_tpl->tpl_vars['data']->value['root'];?>
images/<?php echo $_smarty_tpl->tpl_vars['data']->value['currentOrder'][1];?>
.png" height="14" width="14" /><?php }?></a></th>
            <th><a href="javascript: order('city','list_of_clients_order')">City <?php if ($_smarty_tpl->tpl_vars['data']->value['currentOrder'][0]=="city"){?><img src="<?php echo $_smarty_tpl->tpl_vars['data']->value['root'];?>
images/<?php echo $_smarty_tpl->tpl_vars['data']->value['currentOrder'][1];?>
.png" height="14" width="14" /><?php }?></a></th>
            <th><a href="javascript: order('zip','list_of_clients_order')">ZIP <?php if ($_smarty_tpl->tpl_vars['data']->value['currentOrder'][0]=="zip"){?><img src="<?php echo $_smarty_tpl->tpl_vars['data']->value['root'];?>
images/<?php echo $_smarty_tpl->tpl_vars['data']->value['currentOrder'][1];?>
.png" height="14" width="14" /><?php }?></a></th>
            <th><a href="javascript: order('typeOfCooperation','list_of_clients_order')">Type of cooperation <?php if ($_smarty_tpl->tpl_vars['data']->value['currentOrder'][0]=="typeOfCooperation"){?><img src="<?php echo $_smarty_tpl->tpl_vars['data']->value['root'];?>
images/<?php echo $_smarty_tpl->tpl_vars['data']->value['currentOrder'][1];?>
.png" height="14" width="14" /><?php }?></a></th>
            <th><a href="javascript: order('monthlyFee','list_of_clients_order')">Monthly fee <?php if ($_smarty_tpl->tpl_vars['data']->value['currentOrder'][0]=="monthlyFee"){?><img src="<?php echo $_smarty_tpl->tpl_vars['data']->value['root'];?>
images/<?php echo $_smarty_tpl->tpl_vars['data']->value['currentOrder'][1];?>
.png" height="14" width="14" /><?php }?></a></th>
            <th><a href="javascript: order('contactPerson','list_of_clients_order')">Contact person <?php if ($_smarty_tpl->tpl_vars['data']->value['currentOrder'][0]=="contactPerson"){?><img src="<?php echo $_smarty_tpl->tpl_vars['data']->value['root'];?>
images/<?php echo $_smarty_tpl->tpl_vars['data']->value['currentOrder'][1];?>
.png" height="14" width="14" /><?php }?></a></th>
            <th><a href="javascript: order('active','list_of_clients_order')">Active <?php if ($_smarty_tpl->tpl_vars['data']->value['currentOrder'][0]=="active"){?><img src="<?php echo $_smarty_tpl->tpl_vars['data']->value['root'];?>
images/<?php echo $_smarty_tpl->tpl_vars['data']->value['currentOrder'][1];?>
.png" height="14" width="14" /><?php }?></a></th>
            <th><a href="javascript: order('bad_payer','list_of_clients_order')">Bad payer <?php if ($_smarty_tpl->tpl_vars['data']->value['currentOrder'][0]=="bad_payer"){?><img src="<?php echo $_smarty_tpl->tpl_vars['data']->value['root'];?>
images/<?php echo $_smarty_tpl->tpl_vars['data']->value['currentOrder'][1];?>
.png" height="14" width="14" /><?php }?></a></th>
        </tr>
        <?php $_smarty_tpl->tpl_vars['counter'] = new Smarty_variable(1, null, 0);?>
        <?php  $_smarty_tpl->tpl_vars['client'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['client']->_loop = false;
 $_smarty_tpl->tpl_vars['key'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['data']->value['clients']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['client']->key => $_smarty_tpl->tpl_vars['client']->value){
$_smarty_tpl->tpl_vars['client']->_loop = true;
 $_smarty_tpl->tpl_vars['key']->value = $_smarty_tpl->tpl_vars['client']->key;
?>
            <?php if ($_smarty_tpl->tpl_vars['counter']->value==1){?>
                <?php $_smarty_tpl->tpl_vars['bgClass'] = new Smarty_variable('bgDark', null, 0);?>
            <?php }else{ ?>
                <?php $_smarty_tpl->tpl_vars['bgClass'] = new Smarty_variable('bgLight', null, 0);?>
            <?php }?>
            <tr class="<?php echo $_smarty_tpl->tpl_vars['bgClass']->value;?>
">
                <?php if ($_smarty_tpl->tpl_vars['counter']->value==1){?>
                    <?php $_smarty_tpl->tpl_vars['counter'] = new Smarty_variable(2, null, 0);?>
                <?php }else{ ?>
                    <?php $_smarty_tpl->tpl_vars['counter'] = new Smarty_variable(1, null, 0);?>
                <?php }?>
                <td>
                    <input name="clientId[]" value="<?php echo $_smarty_tpl->tpl_vars['client']->value['klient_id'];?>
" class="clientSelector" type="checkbox" />
                </td>
                <td style="width: 5em"><a class="filterLink" href="<?php echo $_smarty_tpl->tpl_vars['data']->value['root'];?>
?input=edit_client&client=<?php echo $_smarty_tpl->tpl_vars['client']->value['klient_id'];?>
"><?php echo $_smarty_tpl->tpl_vars['client']->value['name'];?>
</a></td>
                <td style="width: 7em"><?php echo $_smarty_tpl->tpl_vars['client']->value['fullName'];?>
</td>
                <td class="center"><?php echo $_smarty_tpl->tpl_vars['client']->value['ICO'];?>
</td>
                <td class="center"><?php echo $_smarty_tpl->tpl_vars['client']->value['ICDPH'];?>
</td>
                <td style="width: 6em" class="center"><?php echo $_smarty_tpl->tpl_vars['client']->value['address'];?>
</td>
                <td class="center"><a class="filterLink" href="javascript: filter('city','<?php echo $_smarty_tpl->tpl_vars['client']->value['city'];?>
','list_of_clients_filter')"><?php echo $_smarty_tpl->tpl_vars['client']->value['city'];?>
</a></td>
                <td class="center"><a class="filterLink" href="javascript: filter('zip','<?php echo $_smarty_tpl->tpl_vars['client']->value['zip'];?>
','list_of_clients_filter')"><?php echo $_smarty_tpl->tpl_vars['client']->value['zip'];?>
</a></td>
                <td style="width: 6em" class="center"><a class="filterLink" href="javascript: filter('typeOfCooperation','<?php echo $_smarty_tpl->tpl_vars['client']->value['typeOfCooperation'];?>
','list_of_clients_filter')"><?php echo $_smarty_tpl->tpl_vars['client']->value['cooperation_info']['type'];?>
</a></td>
                <td style="width: 4em" class="center"><?php echo $_smarty_tpl->tpl_vars['client']->value['monthlyFee'];?>
</td>
                <td style="width: 4em" class="center">
                    <?php if ($_smarty_tpl->tpl_vars['client']->value['contact_person_info']){?>
                        <a class="filterLink" href="javascript: filter('contactPerson','<?php echo $_smarty_tpl->tpl_vars['client']->value['contactPerson'];?>
','list_of_clients_filter')"><?php echo $_smarty_tpl->tpl_vars['client']->value['contact_person_info']['name'];?>
 <?php echo $_smarty_tpl->tpl_vars['client']->value['contact_person_info']['surname'];?>
</a>
                    <?php }?>                
                </td>
                <td class="center">
                    <a class="filterLink" href="javascript: filter('active','<?php echo $_smarty_tpl->tpl_vars['client']->value['active'];?>
','list_of_clients_filter')">
                        <?php if ($_smarty_tpl->tpl_vars['client']->value['active']==0){?>
                            Yes
                        <?php }else{ ?>
                            No
                        <?php }?>
                    </a>
                </td>
                <td class="center">
                    <a class="filterLink" href="javascript: filter('bad_payer','<?php echo $_smarty_tpl->tpl_vars['client']->value['bad_payer'];?>
','list_of_clients_filter')">
                        <?php if ($_smarty_tpl->tpl_vars['client']->value['bad_payer']==1){?>
                            Yes
                        <?php }else{ ?>
                            No
                        <?php }?>
                    </a>
                </td>
            </tr>
        <?php } ?>
    </table>
</form>
<div class="menu-list">
    <span class="pager"><?php echo $_smarty_tpl->tpl_vars['data']->value['pager'];?>
</span>
    Records per page
    <select class="pager" size="1" onchange="changeRecordsPerPage(this.value, 'list_of_clients_pager')">
        <option <?php if ($_SESSION['list_of_clients_pager']==20){?>selected="selected"<?php }?> value="20">20</option>
        <option <?php if ($_SESSION['list_of_clients_pager']==50){?>selected="selected"<?php }?> value="50">50</option>
        <option <?php if ($_SESSION['list_of_clients_pager']==100){?>selected="selected"<?php }?> value="100">100</option>
    </select>
</div><?php }} ?>